package com.chance.cc.crawler.development.command.trigger.domain.pcauto;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.trigger.CrawlerJobTriggerCommand;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author lt
 * @version 1.0
 * @date 2021-01-13 11:14:22
 * @email okprog@sina.com
 */
public class PcAutoWebSchedulerTrigger {
    private static final String domain = "pcauto";

    private static final CrawlerJobTriggerCommand crawlerJobTriggerCommand =
            new CrawlerJobTriggerCommand("192.168.1.215",9599);

    /**
     * 发布太平洋新闻trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoArticleCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "太平洋新闻实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
    /**
     * 发布太平洋新闻回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoArticleTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "太平洋新闻回溯七天回复采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
    /**
     * 发布太平洋论坛trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoForumReleaseCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "太平洋论坛实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
    /**
     * 发布太平洋论坛回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoForumReplyCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "太平洋论坛回溯一天回复采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
/**
     * 发布太平洋论坛回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoForumInteractionCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "太平洋论坛回溯三天互动采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }



    /**
     * 发布太平洋视频trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoVideoCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "太平洋视频实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
    /**
     * 发布太平洋视频回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoVideoTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "太平洋视频回溯七天回复采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }




    /**
     * 发布太平洋口碑trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoPraiseCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "太平洋口碑实时采集任务执行，每小时执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }
    /**
     * 发布太平洋口碑回溯trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoPraiseTraceCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "太平洋口碑回溯七天回复采集任务执行，每天执行一次"
        );
        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

    /**
     * 发布太平洋测试发布trigger info
     * @param crawlerKey
     * @param crawlerTriggerKey
     */
    public static void publishPcAutoTestCrawlerScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage httpPage = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "太平洋测试"
        );

        System.out.println("添加采集调度信息：" + httpPage.getRawText());
        System.out.println("triggerKey: " + crawlerTriggerKey);
    }

}
